#include <iostream>
class Object
{
};
class Container:public Object
{
public:
    struct Bad_op{
        const char* p;
        Bad_op(const char* pp):p(pp){}
    };
    virtual Object* get(){
        throw Bad_op("get");
    }
    virtual void put(Object*){
        throw Bad_op("put");
    }
    virtual Object*& operator[](size_t){
        throw Bad_op("[]");
    }
};
class List:public Container
{
public:
    List(){
        _head = _tail = new Link();
        _head->next = _head;
    }
    Object* get(){
        return ((_head == _tail) ? _tail->data:NULL);
    }
    void put(Object* obj){
        Link* pnode = new Link();
        pnode->data = obj;
        pnode->next = NULL;
        _tail->next = pnode;
        _tail = pnode;
    }
private:
    struct Link
    {
        Object* data;
        Link* next;
    }*_head, * _tail;
};
class Vector:public Container
{
public:
    Object*& operator[](size_t);
};


int main()
{
    List ls;
    ls.put(new Object());
    ls.put(new Object());
    ls.get();
    ls.get();
    
    
}
